package edu.kjxy.worker0312;

import java.util.Scanner;

public class worker12 {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		long num = in.nextLong();
		int sum = 0, ret = 1;
		while(true) {
			long bit = num % 10;
			sum += ret * bit;
			ret *= 2;
			num /= 10;
			if(num == 0) break;
		}
		int num2 = sum;
		StringBuilder binary = new StringBuilder();
		while(num2 > 0) {
			int bit2 = num2 % 16;
			if(bit2 >= 0 && bit2 <= 9) {
				binary.insert(0, bit2);
			}
			else {
				switch(bit2) {
					case 10: binary.insert(0, 'A');break;
					case 11: binary.insert(0, 'B');break;
					case 12: binary.insert(0, 'C');break;
					case 13: binary.insert(0, 'D');break;
					case 14: binary.insert(0, 'E');break;
					case 15: binary.insert(0, 'F');break;
				}
			}
			num2 /= 16;
		}
		System.out.println(binary.toString());
		in.close();
	}

}
